<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="/plugin/bootstrap/css/bootstrap.css" />
  <link rel="stylesheet" href="/plugin/layui/css/layui.css" />
  <link rel="stylesheet" href="/plugin/swiper/swiper.min.css" />
  <link rel="stylesheet" href="/css/myAnimate.css" />
  <link rel="stylesheet" href="/css/common.css" />
  <link rel="stylesheet" href="/css/style.css" />
  <link rel="stylesheet" href="/css/animate.css" />
  <link rel="stylesheet" href="/css/fonts/iconfont.css" />
  <link rel="stylesheet" href="/plugin/bootstrap/dist/datepicker/datetimepicker.min.css" />
  <link rel="stylesheet" href="/plugin/bootstrap/dist/select/select.css" />
  <link rel="stylesheet" href="/plugin/webuploader/webuploader.css" />
  <link rel="stylesheet" href="/css/theme_red.css?r=1" />
  <script type="text/javascript" src="/js/jquery.js"></script>
  <script type="text/javascript" src="/plugin/webuploader/webuploader.min.js"></script>
  <script type="text/javascript" src="/plugin/bootstrap/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="/plugin/layui/layui.js"></script>
  <script type="text/javascript" src="/plugin/bootstrap/dist/datepicker/datetimepicker.min.js"></script>
  <script type="text/javascript" src="/plugin/bootstrap/dist/select/select.js"></script>
  <script type="text/javascript" src="/js/common.js"></script>
  <script type="text/javascript" src="/js/pinyin.js"></script>
</head>

<body class="child_body">
    <div class="comModal p-15">
      <button class="btn btn-info" onclick="dialogShow()">派发</button>
      <button class="btn btn-info" onclick="dialogStatusShow()">
        审批状态
      </button>
      <button class="btn btn-info" onclick="dialogDetailShow()">
        建议详情
      </button>
      <button class="btn btn-info" onclick="dialogMethodShow()">
        新增策略
      </button>
      <button class="btn btn-info" onclick="dialogFilterShow()">
        高级筛选
      </button>
      <button class="btn btn-info" onclick="showUploadFile()">
        上传附件
      </button>
      <button class="btn btn-info" onclick="getMySelect()">
        获取下拉框的值
      </button>
      <button class="btn btn-info" onclick="setMySelect()">
        设置下拉框的值
      </button>
      <div class="row m-t-15">
        <div class="col-md-4">
          <input id="selectTable" class="form-control" placeholder="点击展示弹窗" onclick="showTableDialog()" />
        </div>
        <div class="col-md-4">
          <div class="comSelectBox"  id="searchSelectInput"></div>
        </div>
      </div>
    </div>
    <div class="comModal m-t-15">
      <div class="p-15 fs15">
        <span>上传附件</span>
        <button class="btn btn-info" onclick="getFiles()">获取上传文件</button>
        <button class="btn btn-info" onclick="updateFileData()">插入数据</button>
        <button class="btn btn-info" onclick="clearFileData()">清除数据</button>
      </div>
      <div class="picListBox p-l-15">
        <div class="item fileItem">
            <span class="iconfont icon-add-wide"></span>
            <div class="uploaderBox" id="fileDemoPicker"></div>
        </div>
      </div>
    </div>
    <div id="dispatchDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document" style="width:1000px;">
        <div class="modal-content" style="width:1000px;">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">派发</h4>
          </div>
          <div class="modal-body">
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">附件</label>
              <div class="flex-1">
                <div class="fileBtnBox" id="fileUploadTest">
                  <button class="btn btn-sm btn-info">
                    上传文件
                    <input type="file" onchange="fileUploadChange(this)" />
                  </button>
                  <div class="fileName flex">
                    <span class="flex-1 name"></span>
                    <span class="iconfont icon-close-rs"></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150"><span class="red">*</span>通报单位</label>
              <div class="flex-1">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">抄送单位</label>
              <div class="flex-1">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150"><span class="red">*</span>通报函号</label>
              <div class="flex-1"><input class="form-control" placeholder="请输入通报函号" /></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">通报函号-反馈表</label>
              <div class="flex-1"><input class="form-control" placeholder="请输入通报函号" /></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">反馈截止日期</label>
              <div class="flex-1"><div id="datetimepicker"></div></div>
              
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w150">隐藏通报函</label>
              <div class="flex-1">
                <div class="comRadioBox p-t-5">
                  <label class="radio-inline">
                    <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" />
                    是
                  </label>
                  <label class="radio-inline">
                    <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" />
                    否
                  </label>
                </div>
              </div>
              
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="statusChangeDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog fix-modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">核验待确认</h4>
          </div>
          <div class="modal-body">
            <div class="formItem p-l-r-15">
              <div class="label-block"><span class="red">*</span>核验意见</div>
              <textarea class="form-control textarea"></textarea>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">备注</div>
              <textarea class="form-control textarea"></textarea>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">是否归档</div>
              <div class="comRadioBox">
                <label class="radio-inline">
                  <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1" />
                  是
                </label>
                <label class="radio-inline">
                  <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2" />
                  否
                </label>
              </div>
            </div>
            <div class="formItem p-l-r-15">
              <div class="label-block">附件</div>
              <div class="fileBtnBox" id="fileUploadTest">
                <button class="btn btn-sm btn-info">
                  上传文件
                  <input type="file" onchange="fileUploadChange(this)" />
                </button>
                <div class="fileName flex">
                  <span class="flex-1 name"></span>
                  <span class="iconfont icon-close-rs"></span>
                </div>
              </div>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="advinceDetailDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">建议详情</h4>
          </div>
          <div class="modal-body">
            <ul class="comTab infoTab clearfix m-b-15">
              <li class="active">事件类别</li>
              <li>目录浏览漏洞</li>
            </ul>
            <table class="table table-bordered">
              <thead>
                <tr>
                  <td width="50">序号</td>
                  <td>建议</td>
                </tr>
                </tbody>
              <tbody>
                <tr>
                  <td>1</td>
                  <td>
                    王文涛表示，中美元首旧金山会晤为两国经贸关系发展指明方向，双方应发挥两国商务部沟通交流机制的积极作用，为企业合作创造良好条件。王文涛重点就美国限制第三方对华出口光刻机、成熟制程芯片供应链调查、制裁打压中国企业等表达严正关切。
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="methodAddDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">新增策略</h4>
          </div>
          <div class="modal-body">
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"><span class="red">*</span>策略名称</label>
              <div class="flex-1 relative">
                <input class="form-control" id="searchInput"/>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"><span class="red">*</span>可见部门</label>
              <div class="flex-1 relative">
                <select class="selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
            
            </div>
            <div class="checkList" id="checkList">
              <div class="formItem flex p-l-r-15">
                <label class="form-label w90">第一级</label>
                <div class="flex-1 flex">
                  <select class="flex-1 selectpicker" title="请选择">
                    <option>Mustard</option>
                    <option>Ketchup</option>
                    <option>Barbecue</option>
                  </select>
                  <select class="flex-1 selectpicker" title="请选择">
                    <option>Mustard</option>
                    <option>Ketchup</option>
                    <option>Barbecue</option>
                  </select>
                </div>
                <div class="iconfont icon-delete formOper"></div>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90"></label>
              <div class="flex-1">
                <button class="btn btn-info btn-sm" id="addAprove"><span class="iconfont icon-add-r"></span>添加审核层次</button>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <label class="form-label w90">备注</label>
              <div class="flex-1">
                <textarea class="form-control textarea" placeholder="备注"></textarea>
              </div>
            
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="filterAddDialog" class="modal fade" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header border0">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title">高级筛选</h4>
          </div>
          <div class="modal-body">
            <div class="formItem p-l-r-15">
              <div class="m-b-10">筛选条件</div>
              <div class="filterList" id="filterList">
                <div class="flex m-b-15">
                  <div class="flex-1 m-r-20 selectBox">
                    <select id="filterSelect_1" class="selectpicker" title="请选择">
                      <option value="1">Mustard</option>
                      <option value="2">Ketchup</option>
                      <option value="3">Barbecue</option>
                    </select>
                  </div>
                  <input class="flex-1 form-control" placeholder="请输入筛选条件"/>
                  <div class="m-l-10 iconfont icon-close-rs formOper blue"></div>
                </div>
              </div>
            </div>
            <div class="formItem flex p-l-r-15">
              <button class="btn btn-info btn-sm" id="addFilterBtn"><span class="iconfont icon-add-r"></span>添加筛选条件</button>
            </div>
            <div class="formItem flex p-l-r-15">
              <div class="comCheckBox p-t-5">
                <label class="checkbox-inline">
                  <input type="checkbox" id="inlineCheckbox1" value="option1" />
                  保存为场景
                </label>
              </div>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="editTableDialog" class="modal fade" tabindex="-1" role="dialog"> 
      <div class="modal-dialog" role="document" style="width:1000px;">
        <div class="modal-content" style="width:1000px;">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title algin-center">Table弹窗</h4>
          </div>
          <div class="modal-body">
            <div class="searchForm form-inline row">
              <div class="formItem col-md-4 flex">
                <label class="form-label w150"><span class="red">*</span>策略名称</label>
                <input class="form-control" />
              </div>
              <div class="formItem col-md-4 flex">
                <label class="form-label w150"><span class="red">*</span>可见部门</label>
                <select class="flex-1 selectpicker" title="请选择">
                  <option>Mustard</option>
                  <option>Ketchup</option>
                  <option>Barbecue</option>
                </select>
              </div>
            </div>
            <div class="searchBox p-0">
              <div class="searchBtnBox flex">
                <div class="flex-1 text-right">
                  <button type="button" class="btn btn-info btn-sm m-r-5" onclick="getParams()">
                    <span class="iconfont icon-search"></span>
                    <span class="text">查询</span>
                  </button>
                  <button type="button" class="btn btn-default btn-sm m-r-10" onclick="resetSearch()">
                    <span class="iconfont icon-reset"></span>
                    <span class="text">重置</span>
                  </button>
                </div>
              </div>
            </div>
            <div class="tableBox m-t-15">
              <table class="layui-hide" id="layuiDialogTable" lay-filter="layuiDialogTable"></table>
            </div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info" onclick="getData()">确认</button>
          </div>
        </div>
      </div>
    </div>
    <div id="uploadFileDialog" class="uploadFileDialog modal fade" tabindex="-1" role="dialog"> 
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
            <h4 class="modal-title fs16 blod">上传</h4>
          </div>
          <div class="modal-body text-center">
              <div class="filePickerModal">
                <div class="fileBtn">
                  <div class="hasfile hide">
                    <span class="iconfont icon-wenjianyishangchuanxushangchuan"></span>
                    <div class="m-t-10"><span class="fileName">附件名称</span><span class="delfile iconfont icon-close-r"></span></div>
                  </div>
                 <div class="nofile">
                  <span class="iconfont icon-yunshangchuan"></span>
                  <div>将文件拖到此处或<span class="blue">点击上传</span></div>
                 </div>
                </div>
                <div class="filePicker" id="filePickerView"></div>
              </div>
              <div class="m-t-15">只能上传.xlsx文件，且不超过10M,最大可上传10000条设备记录</div>
              <div class="m-t-15"><a href="javascript:;">下载导入全局资源模板</a></div>
          </div>
          <div class="modal-footer border0">
            <button type="button" class="cancel btn btn-default" data-dismiss="modal">
              取消
            </button>
            <button type="button" class="confirm btn btn-info" onclick="getData()">确认</button>
          </div>
        </div>
      </div>
    </div>
</body>
<script>
  $(function () {
    $("#searchSelectInput").comSelect({
      pySearch:true,
      mutiselect:false,
      dataType:'string',//array
      data:[
        {name:"测试1",id:1,code:'ceshi'},
        {name:"无语2",id:2,code:'wy'},
        {name:"ssww3",id:3,code:'ssww'},
        {name:"罗比4",id:4,code:'luobi'},
        {name:"斗罗5",id:5,code:'douluo'},
        {name:"牛人6",id:6,code:'niuren'}
      ],
    });
    // setMySelect()
    var uploader = $.initUploader({
      picker:"#fileDemoPicker",
      fileSize:10,//文件大小M
      //fileTypes:'jpeg,png'   //String Or Array,
      readonly:false,//是否可编辑
      duplicate:true,//是否允许重复
      showName:true,//显示文件名
      fileNums:2,
      //fileData:[{type:'png',name:'文件名',src:'文件网络路径',id:111}],//初始化静态数据，对象数组
      beforeUpload:function(res){//选择文件后回调
        // alert('文件名称：'+res.name)
        return true;
      },
      beforeRemove:function(fileObj){
        uploader.deleteFile(fileObj);
      }
    })
    window.uploader = uploader
    bindSelectEvent();
    //添加审核层次
    $("#addAprove").on('click',function(){
      // $.each($("#checkList .formItem"),function(dom,ind){
      //   $(dom).children('label').html('第'+numberToChinese(ind+1)+'级')
      // })
        var len = $("#checkList .formItem").length;
        var num = len+1;
        var htm = '<div class="formItem flex p-l-r-15">'+
                '<label class="form-label w90">第'+numberToChinese(num)+'级</label>'+
                '<div class="flex-1 flex">'+
                  '<select id="group_'+num+'_1" class="flex-1 selectpicker" title="请选择">'+
                    '<option>Mustard</option>'+
                    '<option>Ketchup</option>'+
                    '<option>Barbecue</option>'+
                  '</select>'+
                  '<select id="group_'+num+'_2" class="flex-1 selectpicker" title="请选择">'+
                    '<option>Mustard</option>'+
                    '<option>Ketchup</option>'+
                    '<option>Barbecue</option>'+
                  '</select>'+
                '</div>'+
                '<div class="iconfont icon-delete formOper"></div>'+
              '</div>';
        
        $("#checkList").append(htm);     
        $('#group_'+num+'_2,#group_'+num+'_1').selectpicker("refresh");  
    })
    //删除审核层次
    $("#checkList").off('click','.formOper').on('click','.formOper',function(){
      $(this).parents('.formItem').remove();
      $.each($("#checkList .formItem"),function(ind,dom){
        $(dom).children('label').html('第'+numberToChinese(ind+1)+'级')
      })
    })

    //添加筛选
    $("#addFilterBtn").on('click',function(){
      var len = $("#filterList .flex").length;
      var dom = $("#filterList .flex").eq(0).clone();
      var select = $("#filterList .flex").eq(0).find('.selectpicker').clone();
      select.find('.bs-title-option').remove();
      dom.find('.selectBox').empty();
      // var htm = '<div class="flex m-t-15">'+
      //             '<select id="filterSelect_'+(len+1)+'" class="flex-1 selectpicker m-r-20" title="请选择">'+
      //               '<option>Mustard</option>'+
      //               '<option>Ketchup</option>'+
      //               '<option>Barbecue</option>'+
      //             '</select>'+
      //             '<input class="flex-1 form-control" placeholder="请输入筛选条件"/>'+
      //             '<div class="m-l-10 iconfont icon-close-rs formOper blue"></div>'+
      //           '</div>';
        $("#filterList").append(dom);
        $("#filterList .flex").eq(len).find('.selectBox').html(select)
        $("#filterList .flex").eq(len).find('.selectpicker').attr('id','filterSelect_'+(len+1))
        $('#filterSelect_'+(len+1)).selectpicker('render')
        //赋值  取值
        $('#filterSelect_'+(len+1)).selectpicker('val','2');
        console.log($('#filterSelect_'+(len+1)).selectpicker('val'))
        bindSelectEvent()
    });
      //删除筛选
    $("#filterList").off('click','.formOper').on('click','.formOper',function(){
        $(this).parents('.flex').remove();
    })
    $("#searchInput").on('focus',function(e){
      var _val = $(e.target).val();
      var id = $(this).attr('id');
      var searchId = "comSearchResBox_"+id;
      if(_val&&$("#"+searchId).length){
        $("#"+searchId).slideDown()
      }
    })
    $("#searchInput").on('input',function(e){
      var val = e.target.value
      var id = $(this).attr('id');
      var searchId = "comSearchResBox_"+id;
      
      $(this).parent().addClass('relative');
      //请求数据
      var dataList = [{
        content:'第一条数据',
        id:1001,
      },
      {
        content:'第二条数据',
        id:1002,
      },
      {
        content:'第三条数据',
        id:1003,
      }]
      //数据渲染
      var htm = "";
      if($("#"+searchId).length){
        if(dataList&&dataList.length&&val){
          for(var i in dataList){
            var item = dataList[i];
            htm+='<li class="ellipsis" title="'+item.content+'" data-item='+JSON.stringify(item)+'>'+item.content+'</li>'
          }
        }
          $("#"+searchId).children('ul').html(htm)
          // $("#"+searchId).slideUp(); //收回搜索
          $("#"+searchId).slideDown();
      }else{
        htm = '<div id="'+searchId+'" class="comSearchResBox">'
        htm+='<ul>'

          for(var i in dataList){
            var item = dataList[i];
            htm+='<li class="ellipsis" title="'+item.content+'" data-item='+JSON.stringify(item)+'>'+item.content+'</li>'
          }
        htm+='</ul></div>';
        $(this).after(htm);
        $("#"+searchId).slideDown();
      }
     
      $("#"+searchId+" li").off('click').on('click',function(e){
        $(e.target).addClass('active').siblings().removeClass('active');
        var _data =  $(e.target).data('item');
        // var _json = JSON.parse(_data)
        $("#"+searchId).slideUp();
        $("#"+id).val(_data.content).data('item',_data);
      })
      $("#"+id).on('blur',function(){
        $("#"+searchId).slideUp();
      })
    })
    $("#datetimepicker").datePicker({
      dateType: "date",
      format: "datetime",
    });
  });
  function getMySelect(){
    alert($("#searchSelectInput").getSelectValue());
  }
  function setMySelect(){
    $("#searchSelectInput").setSelectValue('2,3')
  }
  //更新附件数据
  function updateFileData(){
    var dataList = [{type:'png',name:'插入文件',src:'../images/user_head.png',id:111}];
    var needClear = false;//是否需要清除旧数据
    if(dataList.length){
      window.uploader.updateFiles(dataList,needClear);
    }
  }
  function showUploadFile(){
    var myUpload;
   
    $("#uploadFileDialog").off('shown.bs.modal').on('shown.bs.modal',function(){
      myUpload = $.initUploader({
        picker:"#filePickerView",
        dnd:"#filePickerView",
        fileSize:10,//文件大小M
        fileTypes:'jpg' ,  //String Or Array,
        readonly:false,//是否可编辑
        duplicate:true,//是否允许重复
        showName:false,//显示文件名
        viewType:'once',//list once  列表结构，还是单独结构
        //fileData:[{type:'png',name:'文件名',src:'文件网络路径',id:111}],//初始化静态数据，对象数组
        beforeUpload:function(res){//选择文件后回调
          // alert('文件名称：'+res.name)
          $("#uploadFileDialog .fileName").html(res.name);
          $("#uploadFileDialog .nofile").addClass('hide')
          $("#uploadFileDialog .hasfile").removeClass('hide')
          return true;
        },
        beforeRemove:function(fileObj){
          myUpload.deleteFile(fileObj);
          $("#uploadFileDialog .nofile").removeClass('hide')
      $("#uploadFileDialog .hasfile").addClass('hide')
        }
      });
      $("#uploadFileDialog").off('click','.delfile').on('click','.delfile',function(){
        myUpload.clearInput();
        $("#filePickerView").show();
        $("#uploadFileDialog .fileName").html('');
        $("#uploadFileDialog .nofile").removeClass('hide')
        $("#uploadFileDialog .hasfile").addClass('hide')
      })
      
    });
    $("#uploadFileDialog").off('hide.bs.modal').on('hide.bs.modal',function(){
      $("#filePickerView").empty();
      $("#filePickerView").show();
      $("#uploadFileDialog .fileName").html('');
      $("#uploadFileDialog .nofile").removeClass('hide')
      $("#uploadFileDialog .hasfile").addClass('hide')
      myUpload.clearInput();
    });
    $("#uploadFileDialog").modal("show");
  }
  //清除附件数据
  function clearFileData(){
    window.uploader.clearFiles();
  }
  //获取上传的图片
  function getFiles(){
    var res = window.uploader.getFiles();
    console.log(res)
  }
  function dialogShow() {
    $("#dispatchDialog").modal("show");
  }
  function dialogStatusShow() {
    $("#statusChangeDialog").modal("show");
  }
  function dialogDetailShow() {
    $("#advinceDetailDialog").modal("show");
  }
  function dialogMethodShow() {
    $("#methodAddDialog").modal("show");
  }
  function dialogFilterShow(){
    $("#filterAddDialog").modal("show");
  }
  function showTableDialog() {
    $("#editTableDialog").modal("show");
    $.layuiTable({
      id: "layuiDialogTable",
      done: bindTableEvent,
      size:'sm',
      cols: [
        //表头
        { type: "checkbox",width:50 },//radio
        { field: "username", title: "用户名",width:200 },
        { field: "experience", title: "积分", },
        { field: "sex", title: "性别" },
        {field: "score",title: "评分",},
        { field: "city", title: "城市" },
        { field: "sign", title: "签名" },
        { field: "classify", title: "职业" },
        {field: "wealth",title: "财富",},
      ],
      data: [
        { username: "test1", id: 1001,"LAY_CHECKED":true},//默认选中
        { username: "test2", id: 1002 },
      ],
    });
  }
  function bindTableEvent(res,table) {
    console.log(table)
    window.dialogTable = table
    table.on('row(layuiDialogTable)',function(obj){
      console.log($(obj.tr).data('index'))
      //单选
      if(!$(obj.tr).find('.layui-form-radio').hasClass('layui-form-radioed')){
        $(obj.tr).find('.layui-form-radio').trigger('click')
        
      }
      //多选
      if(!$(obj.tr).find('.layui-form-checkbox').hasClass('layui-form-checked')){
        // $(obj.tr).find('.layui-form-checkbox').trigger('click')
      }else{
        
        // $(obj.tr).find('.layui-form-checkbox').trigger('click')
      }
    })
  }
  function getData(){
    var data = window.dialogTable.checkStatus('layuiDialogTable').data
    //这边在input里面绑定id数据    通过$("#id").data('id')获取
    //这是单选
    $("#selectTable").data('id',data.id).val(data.username);
    //多选
    var ids = [],names=[];
    for(var i in data){
      var item = data[i];
      ids.push(item.id)
      names.push(item.username)
    }
    $("#selectTable").data('id',ids.join(',')).val(names.join(','));
    $("#editTableDialog").modal("hide");
    console.log($("#selectTable").data('id'))
  }
</script>

</html>